package com.gmrz.webauthn.protocol.v1.json;

import com.gmrz.webauthn.protocol.v1.schema.PublicKeyCredentialParameters;
import com.google.gson.*;

import java.lang.reflect.Type;


public class PublicKeyCredentialParametersAdapter
        implements InstanceCreator<PublicKeyCredentialParameters>, JsonSerializer<PublicKeyCredentialParameters>, JsonDeserializer<PublicKeyCredentialParameters> {
    public JsonElement serialize(PublicKeyCredentialParameters parameters, Type arg1, JsonSerializationContext arg2) {
        JsonObject parametersObj = new JsonObject();

        parametersObj.addProperty("alg", parameters.getAlg().getCoseAlgID());
        parametersObj.addProperty("type", parameters.getType().getValue());

        return parametersObj;
    }


    public PublicKeyCredentialParameters deserialize(JsonElement arg0, Type arg1, JsonDeserializationContext arg2)
            throws JsonParseException {
        return null;
    }


    public PublicKeyCredentialParameters createInstance(Type arg0) {
        return null;
    }
}
